package com.nbsaas.boot.data.rest.convert;

import com.nbsaas.boot.data.data.entity.QueryDebug;
import com.nbsaas.boot.data.api.domain.simple.QueryDebugSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 调试记录-列表对象转换器
*/

public class QueryDebugSimpleConvert implements Converter<QueryDebugSimple, QueryDebug> {




@Override
public QueryDebugSimple convert(QueryDebug source) {
    QueryDebugSimple result = new QueryDebugSimple();


               try {
                   if(source.getQueryTemplate()!=null){
                       result.setQueryTemplate(source.getQueryTemplate().getId());
                   }
                } catch (Exception ignored) { }

                result.setParam(source.getParam());

                try {
                    if(source.getQueryTemplate()!=null){
                        result.setQueryTemplateName(source.getQueryTemplate().getName());
                    }
                } catch (Exception ignored) { }

                result.setDebugInfo(source.getDebugInfo());
                result.setId(source.getId());
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}